package com.qiaofang.collectmanage.facade.impl;

import com.qiaofang.collectmanage.service.CollectQualityService;
import com.qiaofang.collectmanage.stub.constants.CollectQualityResponseCode;
import com.qiaofang.collectmanage.stub.facade.CollectQualityFacade;
import com.qiaofang.collectmanage.stub.response.TimeStatisticsEntryResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by generator on 2018-8-1 20:37:55
 */
@RestController
public class CollectQualityFacadeImpl implements CollectQualityFacade {

    @Autowired
    private CollectQualityService qualityService;

    @Override
    public TimeStatisticsEntryResponse timeStatisticsEntry() {
        TimeStatisticsEntryResponse response = new TimeStatisticsEntryResponse();
        int count = qualityService.timeStatisticsEntry();
        if (count < 0) {
            response.setResponseCode(CollectQualityResponseCode.RC_IMESTATISTICS_ERROR.getResponseCode());
            response.setResponseMessage(CollectQualityResponseCode.RC_IMESTATISTICS_ERROR.getResponseMessage());
        }
        return response;
    }
}
